function Data = surogateObj
% test problem G4 by Koziel and Michalewicz [1999], integrality constraints
% added
%--------------------------------------------------------------------------
%Copyright (c) 2012 by Juliane Mueller
%
% This file is part of the surrogate model module toolbox.
%
%--------------------------------------------------------------------------
%Author information
%Juliane Mueller
%Tampere University of Technology, Finland
%juliane.mueller2901@gmail.com
%--------------------------------------------------------------------------
%

%%

load objmat

if(S.bioheat==1)                               %define objective function
    Data.objfunction=@(v) bioheat_obj(v);
elseif(S.bioheat==0)
    Data.objfunction=@(v) simulated_obj(v);
end

if(S.bioheat==0)                               %define constraints 
    if(S.needle_num==2)
        n_x    = 10;                           % 'n_x' state
        Data.xlow = [S.minX S.minY S.minZ S.minX S.minY S.minZ 0 0 0 0];
        Data.xup = [S.maxX S.maxY S.maxZ S.maxX S.maxY S.maxZ 180 180 180 180];
    elseif(S.needle_num==3)
        n_x  = 15;
        Data.xlow = [S.minX S.minY S.minZ S.minX S.minY S.minZ 0 0 0 0 S.minX S.minY S.minZ 0 0];
        Data.xup = [S.maxX S.maxY S.maxZ S.maxX S.maxY S.maxZ 180 180 180 180 S.maxX S.maxY S.maxZ 180 180];
    end
end

if(S.bioheat==1)
        Data.xlow=[S.boundx+S.b S.boundy+S.b S.boundz+S.b 0 0]; 
        Data.xup=[ max(S.x)-min(S.x)+S.boundx-S.b  max(S.y)-min(S.y)+S.boundy-S.b  max(S.z)-min(S.z)+S.boundz-S.b 180 180];
        if(S.needle_num==2)
            n_x    = 10;                           % 'n_x' state
            Data.xlow = [Data.xlow Data.xlow];
            Data.xup = [Data.xup Data.xup];
        elseif(S.needle_num==3)
            n_x  = 15;
            Data.xlow = [Data.xlow Data.xlow Data.xlow];
            Data.xup = [Data.xup Data.xup Data.xup];
        elseif(S.needle_num==4)
            n_x  = 20;
            Data.xlow = [Data.xlow Data.xlow Data.xlow Data.xlow];
            Data.xup = [Data.xup Data.xup Data.xup Data.xup];
        elseif(S.needle_num==5)
            n_x  = 25;
            Data.xlow = [Data.xlow Data.xlow Data.xlow Data.xlow Data.xlow];
            Data.xup = [Data.xup Data.xup Data.xup Data.xup Data.xup];
        end
end

Data.dim=n_x; %problem dimension
Data.integer = []; %indices of integer variables
Data.continuous = [1:n_x]; %indices of continuous variables
end %function